package org.traffometer.traffobase.control;

/**
 * Provides a type-safe enumeration for JSP Page names.
 *
 * @author Philip M. Johnson
 * @author Jitender Miglani (did minor changes)
 */
public class Page {
  /** The filename of the JSP page. */
  private final String fileName;

  /** The title of the JSP page. */
  private final String title;

  /** Error page for exceptions. */
  public static final Page ERROR = new Page("/Error.jsp", "Error Page");

  /** Home page for application. */
  public static final Page INDEX = new Page("/index.jsp", "Home Page");

  /**
   * Constructs the JSP Page instance.
   * @param fileName The filename of the JSP page
   * @param title The title of the JSP page
   */
  private Page(String fileName, String title) {
    this.fileName = fileName;
    this.title = title;
  }


  /**
   * Gets the title attribute of the Page object.
   *
   * @return The title value
   */
  public String getTitle() {
    return this.title;
  }


  /**
   * Gets the fileName attribute of the Page object.
   *
   * @return The fileName value
   */
  public String getFileName() {
    return this.fileName;
  }
}
